def galReader(fName,firstIndex = 0):
    
    f = open(fName,"r")
    N = int(f.readline().strip())

    w = {}
    temp = f.readline()
    while temp <> "":
        i,nj = map(int,temp.strip().split())
        iTemp = f.readline()
        w[i-firstIndex] = []
        if nj > 0:
            theJs = map(int,iTemp.strip().split())
        for j in theJs:
            w[i-firstIndex].append(j-firstIndex)
        temp = f.readline()
    f.close()
    return w

if __name__ == "__main__":
    pass
    w = galReader("Cairo3Rook.GAL",1)
